<?php include("src/updateRequest_cs.php"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css/style.css" rel="stylesheet" type="text/css" />
<title>Update Business :: First United Services LLC</title>
<script language="javaScript" type="text/javascript" src="js/jquery.js"></script>
<script>J = jQuery.noConflict()</script>
<script language="javascript" type="text/javascript">

	
	function validateRequest()
	{ 
		var msg    = '';
		
		var ban_code   		= document.getElementById("ban_code").value;
		var baco_code 		= document.getElementById("baco_code").value;     
		var use_code     	= document.getElementById("use_code").value;
		var pro_code     	= document.getElementById("pro_code").value;
 
		
		if(ban_code == '') 
			msg='- Please select a Bank Name. \n';
		
		if(baco_code == '') 
			msg= msg+'- Please select a client bank name. \n';
		
		if(use_code == '') 
			msg= msg+'- Please select an Adviser. \n';
	
		if(pro_code == '') 
			msg= msg+'- Please select a Case No. \n';
		
		if(msg=='')
		{
			document.getElementById('form').submit();
			return true;
		}
		else
		{
			alert(msg);
			return false;
		}		
	}
	

	function onlyNumbers(e)
	{
	   var key;
	   if(window.event)
		  key = window.event.keyCode;   //IE
	   else
		  key = e.which;                //firefox
	   if (!( (key >= 48 && key <= 57) || key ==8 || key ==9 || key ==0 || key ==46 ))
		  return false;
	   else
		  return true;
	}	

</script>
</head>
<body>
<?php $item_select = 2; include("menu.php");?><br />
 <form name="form" id="form" method="post" action="" enctype="multipart/form-data">
 <input type="hidden" name="edit" id="edit" value="1"/>	

    <div class="content_grv">
    	<table width="80%" align="center" class="shadow">
        	<tr>
            	<td class="title">Edit Business</td>
            </tr>
            <tr>
            	<td>
                	<table class="tbl_form" align="center">
                                   <tr>
                                        <td align="right"><span class="lbl_gray">Bank Name:</span></td>
                                        <td>&nbsp;</td>
                                        <td>
                                        <select name="ban_code" id="ban_code" class="text_grv">
											<?php 
                                            for($i=0; $i<count($banks);$i++) 
                                            {
                                            $select = '';
                                            if($data->ban_code==$banks[$i]->ban_code) 
                                                $select = 'selected="selected"';
                                            ?>
                                            <option value="<?php echo $banks[$i]->ban_code;?>" <?php echo $select;?>><?php echo $banks[$i]->ban_name;?></option>
                                            <?php }?>
                                        </select>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right"><span class="lbl_gray">bank Contact Name:</span></td>
                                        <td>&nbsp;</td>
                                        <td>
                                        <select name="baco_code" id="baco_code" class="text_grv">
											<?php 
                                            for($i=0; $i<count($bankContact);$i++) 
                                            {
                                            $select = '';
                                            if($data->baco_code==$bankContact[$i]->baco_code) 
                                                $select = 'selected="selected"';
                                            ?>
                                            
                                            <option value="<?php echo $bankContact[$i]->baco_code;?>" <?php echo $select;?>><?php echo $bankContact[$i]->baco_name;?></option>
                                            <?php }?>
                                        </select>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right"><span class="lbl_gray">Adviser:</span></td>
                                        <td>&nbsp;</td>
                                        <td>
                                        <select name="use_code" id="use_code" class="text_grv">
											<?php 
                                            for($i=0; $i<count($users);$i++) 
                                            {
                                            $select = '';
                                            if($data->use_code==$users[$i]->use_code) 
                                                $select = 'selected="selected"';
                                            ?>
                                            
                                            <option value="<?php echo $users[$i]->use_code;?>" <?php echo $select;?>><?php echo $users[$i]->use_name." ".$users[$i]->use_lastname;?></option>
                                            <?php }?>
                                        </select>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right"><span class="lbl_gray">Case Number:</span></td>
                                        <td width="1%">&nbsp;</td>
                                        <td>
                                            <select name="pro_code" id="pro_code" class="text_grv">
                                                <?php 
                                                for($i=0; $i<count($property);$i++) 
                                                {
                                                $select = '';
                                                if($data->pro_code==$property[$i]->pro_code) 
                                                    $select = 'selected="selected"';
                                                ?>
                                                
                                                <option value="<?php echo $property[$i]->pro_code;?>" <?php echo $select;?>><?php echo $property[$i]->pro_name;?></option>
                                                <?php }?>
                                            </select>
                                        </td>
                                    </tr>
                                   <tr>
                                        <td colspan="3" align="center">&nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td colspan="3" align="center">
                                         <input type="button" class="button_grv" value="Save" onclick="javascript: return validateRequest();" />
                                         <input type="reset" value="Reset" class="button_grv"/>
                                        <input type="button" class="button_grv" value="Cancel" onClick="javascript:window.history.back(-1);" />
                                        </td>
                                    </tr>
                                </table>
                </td>
            </tr>
        </table>
    </div>
</form>    
</body>
</html>
